﻿#pragma once

#ifndef DOWNLOAD_H
    #define DOWNLOAD_H

// C++ includes
#include <iostream>
#include <string>
#include <fstream>

// Third-party includes
#if defined(_DEBUG) || defined(DEBUG)
	#pragma comment(lib, "curl_x64-windows/debug/lib/libcurl-d.lib")
	#pragma comment(lib, "zlib_x64-windows/debug/lib/zlibd.lib")
#else
	#pragma comment(lib, "curl_x64-windows/lib/libcurl.lib")
	#pragma comment(lib, "zlib_x64-windows/lib/zlib.lib")
#endif

#include "curl_x64-windows/include/curl/curl.h"
#include "zlib_x64-windows/include/zlib.h"


// 回调函数，用于写入下载的数据到文件
extern size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp);

// 函数用于下载文件
extern int download_file(const std::string& url, const std::string& filename);

#endif // DOWNLOAD_H